/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package econosim;

/**
 *
 * @author Steve Noble
 *
 * Profit Agent puts money into a seperate account when receiving money
 *
 */
public abstract class ProfitAgent extends UtilityAgent {

	private double profit = 0;

    public void moveProfitToSavings() {
       super.receiveMoney(profit);
        profit = 0;
    }

    public double getProfit() {
        return profit;
    }

    @Override
	public synchronized void receiveMoney(double price) {
		profit += price;
	}
}
